package com.xayy.mgt.model.dto;

import cn.kawins.mybatis.util.SnowflakeId;
import cn.kawins.spring.mvc.validator.Group;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Column;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * 装备画像关系节点DTO
 * @author plq
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
public class NodeInfoDto2 {

    @KeySql(genId = SnowflakeId.class)
    @ApiModelProperty(value = "主键ID")
    @Null(message = "新增时ID为null",groups = Group.Insert.class)
    @NotNull(message = "ID不能为空",groups = {Group.Update.class})
    private Long id;

    /**
     * 父id
     */
    @ApiModelProperty(value = "父id")
    @NotNull(message = "父id不能为空",groups = {Group.Insert.class,Group.Update.class})
    private Long parentId;

    /**
     * 节点名称
     */
    @ApiModelProperty(value = "节点名称")
    @NotBlank(message = "节点名称不能为空",groups = {Group.Insert.class,Group.Update.class})
    private String name;

    /**
     * 节点名称
     */
    @ApiModelProperty(value = "节点编号")
    @NotBlank(message = "节点编号不能为空",groups = {Group.Insert.class,Group.Update.class})
    private String code;

    /**
     * 节点类型：1健康节点，2效能节点
     */
    @ApiModelProperty(value = "节点类型：0公用节点，1健康节点，2效能节点")
    @NotBlank(message = "节点类型不能为空",groups = {Group.Insert.class,Group.Update.class})
    private String type;

    /**
     * 节点颜色
     */
    @ApiModelProperty(value = "节点颜色")
    @NotBlank(message = "节点颜色不能为空",groups = {Group.Insert.class,Group.Update.class})
    private String color;
    /**
     * 权重
     */
    @ApiModelProperty(value = "权重")
    @NotNull(message = "权重不能为空",groups = {Group.Insert.class,Group.Update.class})
    private Double weight;

    /**
     * 是否是单装备：判断是不是单个整体装备，而不是装备的分系统等
     */
    @ApiModelProperty(value = "是否是单装备：1是0否")
    @NotBlank(message = "是否是单装备不能为空",groups = {Group.Insert.class,Group.Update.class})
    private String isEquip;

    /**
     * 单装备图标id，关联文件表
     */
    @ApiModelProperty(value = "单装备图标id，关联文件表")
    @Column(name = "icon_id")
    private Long iconId;

}